#include <stdio.h>

void printBinary(unsigned char num) {
    for (int i = 7; i >= 0; i--) {
        printf("%d", (num >> i) & 1);
    }
}

int main() {
    unsigned char counter = 0b01010010; // 初始值
    int count = 1; // 计数器序号

    while ((counter & 0xF0) != 0xF0) { // 检查高4位是否为1111
        printf("Binary: ");
        printBinary(counter);
        printf("  Decimal Count: %d\n", count);

        counter++; // 加一
        count++;   // 序号加一
    }

    // 打印最后一个数
    printf("Binary: ");
    printBinary(counter);
    printf("  Decimal Count: %d\n", count);

    return 0;
}